let bar01 = document.getElementById("bar01");
let bar02 = document.getElementById("bar02");
let dot01 = document.getElementById("dot01");
let dot02 = document.getElementById("dot02");

let m = 0;
let n = 0;
bar01.addEventListener("click", function (e) {
  //获得鼠标的位置
  var b = e.pageX;
  //获得div的距离
  var c = bar01.offsetLeft + 966;
  //计算鼠标的坐标
  var x = b - c;
  m = x;
  dot01.style.width = m + "px";
});

var int = self.setInterval(function () {
 
  if (timer == null) {
    timer = setInterval(() => {
      m += 5;
      // 给宽进行递增
      dot01.style.width = m + "px";
      // 给百分比递增
      if (m >= 230) {
        m = 0;
        console.log("sssssssssssssssa");
      }
    }, 100);
  }
}, 2000);
